﻿using UnityEngine;
using System.Collections;

public class UI_LOGO : MonoBehaviour {


	private UIButton Btn_Start;

	private void StartComponentLink()
	{
		MonoBehaviour[] mono = gameObject.GetComponentsInChildren<MonoBehaviour>();

		foreach( MonoBehaviour component in mono )
		{
			string name = component.name;
			switch ( name )
			{
				case "Btn_Start":
				if ( component is UIButton )
					Btn_Start = component as UIButton;break;
			}
		}

	}


	void Awake()
	{
		StartComponentLink();
		Init();
	}

	void Init()
	{
		UIEventListener.Get(Btn_Start.gameObject).onClick = OnClick;

	}

	void OnClick( GameObject go )
	{
		Main.UIManager.CloseUI(UIManage.UI_NUMBER_LOGO);
		Main.UIManager.ShowUI(UIManage.UI_NUMBER_MAIN);
	}

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}
}
